# !/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName : p8.py
# @Time     : 2024/5/8 22:59
# @Author   : Robot-Zsj
"""
description:

小华地图寻宝

https://fcqian.blog.csdn.net/article/details/134674604

i:
40 40 18

o:
1484
"""

# dfs

import sys

sys.setrecursionlimit(5000)

m, n, k = map(int, input().split())

ans = 0
visited = set()
offsets = ((-1, 0), (1, 0), (0, -1), (0, 1))

digitSums = [0] * (max(m, n))

for i in range(len(digitSums)):
    num = i
    while num > 0:
        digitSums[i] += num % 10
        num //= 10


def dfs(x, y):
    if x < 0 or x >= m or y < 0 or y >= n:
        return

    if digitSums[x] + digitSums[y] > k:
        return

    pos = x * n + y

    if pos in visited:
        return

    visited.add(pos)

    global ans
    ans += 1

    for offsetX, offsetY in offsets:
        newX = x + offsetX
        newY = y + offsetY
        dfs(newX, newY)

dfs(0,0)
print(ans)